﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using roysland.net.xcom.core.Helpers;

namespace roysland.net.xcom.core.Models
{
    public class CraftStat
    {
        public CraftStat(byte[] buffer)
        {
            RecordBuffer = buffer;
        }

        public CraftStat(byte[] buffer, int recordNumber)
        {
            RecordBuffer = buffer;
            RecordNumber = recordNumber;
        }




        #region Properties
        public int RecordNumber { get; set; }
        public string FriendlyName { get; set; }
        public byte[] RecordBuffer { get; set; }
        //BytesToInt

        public int NamePointer
        {
            get { return ByteHelper.ByteToInt(0, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        public int Points
        {
            get { return ByteHelper.ByteToInt(1, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        public int WeaponPods
        {
            get { return ByteHelper.ByteUGEToInt(2, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        public int MaximumSpeed
        {
            get { return ByteHelper.ByteToInt(3, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        public int Acceleration
        {
            get { return ByteHelper.ByteToInt(4, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        public int Fuel
        {
            get { return ByteHelper.ByteToInt(5, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        public int Damage // Armor
        {
            get { return ByteHelper.ByteToInt(6, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        public int SizeClass
        {
            get { return ByteHelper.ByteToInt(7, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        public int FiringInterval // ??
        {
            get { return ByteHelper.ByteToInt(8, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        public int DestroyScore // ??
        {
            get { return ByteHelper.ByteToInt(9, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        public int WeaponRange
        {
            get { return ByteHelper.ByteToInt(10, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        public int WeaponDamage
        {
            get { return ByteHelper.ByteToInt(11, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        public int Crew
        {
            get { return ByteHelper.ByteToInt(12, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        public int Hwp
        {
            get { return ByteHelper.ByteToInt(13, RecordBuffer); }
            //set { RecordBuffer[34] = ByteHelper.IntToByte(value); }
        }

        #endregion
    }
}
